FROM node:14-alpine
ENV TZ="Asia/Shanghai"
MAINTAINER LCR
WORKDIR /yapi

COPY repositories /etc/apk/repositories

COPY start.sh /yapi

RUN apk update \
    && apk add git

#RUN git clone --depth=1 https://gitee.com/mirrors/YApi.git vendors
RUN git clone --depth=1 https://github.com/YMFE/yapi.git vendors

RUN cp vendors/config_example.json ./config.json \
    && cd vendors \
    && rm -f package-lock.json \
    && npm install --production --registry https://registry.npm.taobao.org \
    && npm install -g pm2

EXPOSE 3000

CMD ["sh", "start.sh"]